import { defineStore } from 'pinia';

/**
 * 布局配置
 * 修改配置时：
 * 1、需要每次都清理 `window.localStorage` 浏览器永久缓存
 * 2、或者点击布局配置最底部 `一键恢复默认` 按钮即可看到效果
 */
export const useThemeConfig = defineStore('themeConfig', {
	state: (): ThemeConfigState => ({
		themeConfig: {
			"isDrawer": false,
			"primary": "#1890FF",
			"isIsDark": false,
			"topBar": "#ffffff",
			"topBarColor": "#282C34",
			"isTopBarColorGradual": false,
			"menuBar": "#FFFFFF",
			"menuBarColor": "#303133",
			"menuBarActiveColor": "rgba(232, 244, 255, 1)",
			"isMenuBarColorGradual": false,
			"columnsMenuBar": "#282C34",
			"columnsMenuBarColor": "#e6e6e6",
			"isColumnsMenuBarColorGradual": false,
			"isColumnsMenuHoverPreload": false,
			"isCollapse": false,
			"isUniqueOpened": true,
			"isFixedHeader": true,
			"isFixedHeaderChange": false,
			"isClassicSplitMenu": false,
			"isLockScreen": false,
			"lockScreenTime": 30,
			"isShowLogo": true,
			"isShowLogoChange": false,
			"isBreadcrumb": true,
			"isTagsview": true,
			"isBreadcrumbIcon": false,
			"isTagsviewIcon": false,
			"isCacheTagsView": false,
			"isSortableTagsView": true,
			"isShareTagsView": false,
			"isFooter": false,
			"isGrayscale": false,
			"isInvert": false,
			"isWartermark": false,
			"wartermarkText": "tmadmin",
			"tagsStyle": "tags-style-five",
			"animation": "slide-right",
			"columnsAsideStyle": "columns-round",
			"columnsAsideLayout": "columns-vertical",
			"layout": "columns",
			"isRequestRoutes": true,
			"globalTitle": "tmadmin",
			"globalViceTitle": "tmadmin",
			"globalViceTitleMsg": "优雅 / 简洁 / 高效",
			"globalI18n": "zh-cn",
			"globalComponentSize": "default"
		},
	}),
	actions: {
		setThemeConfig(data: ThemeConfigState) {
			this.themeConfig = data.themeConfig;
		},
	},
});
